/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.model.service;

import com.model.dao.orm.AbstractSesionDao;
import com.model.dao.orm.Key;
import java.util.List;


/**
 *
 * @author Rdelacruz
 * @param <C>
 */
public class AbstractServiceOrm<C extends Key> 
extends AbstractService
{        
    private AbstractSesionDao<C> dao;
    
    public List<C> findByAll() {
        return dao.findAll();
    }
    
    public C findByKey(String key) {
        return dao.findByKey(key);
    }    
    
    C findByObjeto(C objeto) {
        return dao.findByObjeto(objeto);
    }

    
    public C save(C objeto) {
        return dao.save(objeto);
    }
    
    void clear() {
        dao.clear();
    }

    public AbstractSesionDao<C> getDao() {
        return dao;
    }

    public void setDao(AbstractSesionDao<C> dao) {
        this.dao = dao;
    }
    
}
